home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / sw / main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.3 KB  |  86 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #ifndef MAIN_H
  18. #define    MAIN_H
  19.  
  20. #include "resources.h"
  21. #include "sw_comm.h"
  22. class SbVec2s;
  23. class SbVec3f;
  24. class ShipObject;
  25.  
  26. int            self(const ShipObject*);// TRUE if it's my ship
  27. int            self(InAddr);        // TRUE if it's my ship
  28. int            self(NetId);        // TRUE if it's my ship
  29. void            restartSelf();        // restart my ship
  30. SwServer*        server();        // return server
  31. void            quitSpaceWar();        // exit game
  32. int            numberPlayers();    // get number of players
  33. ShipObject*        getPlayer(int num);    // get ship info
  34. int            addPlayer(ShipObject*);    // returns TRUE if successful
  35. ShipObject*        removePlayer(int num);    // returns removed ship
  36. int            lookupPlayer(NetId);    // find player by network id
  37. TeamInfo&        getTeam(Team);        // get team information
  38. void            setTeam(const TeamInfo& info);
  39. int            numberTargets();    // number targets available
  40. int            currentTarget();    // number of current target
  41. ShipObject*        getTarget(int num);    // get target info
  42. void            nextTarget();        // select next target
  43. void            prevTarget();        // select previous target
  44. void            noTarget();        // set to no target
  45. float            radarRange();        // current radar range (m)
  46. void            increaseRange();    // go to next highest range
  47. void            decreaseRange();    // go to next lowest range
  48. Weapon            currentWeapon();    // get current weapon
  49. void            currentWeapon(Weapon);    // set current weapon
  50. void            toggleFps();        // toggle fps display
  51. int            isFpsOn();        // TRUE if fps displayed
  52. int            getFps();        // returns current fps
  53. SbVec2s&        viewScreenSize();    // returns view size in pixels
  54. void            showHelp();        // pause and show help
  55. void            pauseGame();        // pause game (if not paused)
  56. void            resumeGame();        // resume game (if paused)
  57. void            togglePauseGame();    // toggle 'tween paused/resumed
  58. int            isPaused();        // TRUE if game paused
  59. void            quitGame();        // exit game
  60. ShipObject*        makeShip(ShipClass, NetId, Team, const char*);
  61. float            explodeVolume(float p[3], float v = 1.0);
  62.  
  63. // return direction of pixel in local space
  64. void            getViewDirection(const SbVec2s& p, SbVec3f& v);
  65.  
  66. // return pixel location of direction in local space (FALSE if behind)
  67. int            getViewPosition(const SbVec3f& v, SbVec2s& p);
  68.  
  69. // view screen position, relative size, and visibility of every object
  70. struct ObjectView {
  71.   public:
  72.     SbVec3f        lp;            // local position
  73.     int            visible;        // TRUE if on screen
  74.     int            exploding;        // TRUE if exploding
  75.     short        p[2];            // view screen position
  76.     short        r;            // radius of object in pixels
  77. };
  78.  
  79. extern ObjectView    playerView[MAXPLAYERS][MAXMISSILES+1];
  80. extern ObjectView    asteroidView[MAXASTEROIDS];
  81. extern ObjectView    flagView[NUMTEAMS];
  82. extern ObjectView    missileLock;
  83. extern int        wasFlagCaptured;    // TRUE if my flag just captured
  84.  
  85. #endif
  86.